<%-- 
    Document   : listautenti
    Created on : 22-ott-2012, 18.24.25
    Author     : sflesca
--%>

<%@page import="entity.Categoria"%>
<%@page import="java.util.List"%>
<%@page import="entity.Utente"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Lista Categorie</h1>
        <jsp:useBean id="messaggio" class="java.lang.String" scope="request" />
        <%=messaggio %>
        <%
            List lc = (List) request.getAttribute("listacat");
            if (lc == null) {
        %>
        <h1>Vuota!!</h1>
        <%        } else {
        %>
        <table style="text-align: left; width: 100%;" border="1"
               cellpadding="2" cellspacing="2">
            <tbody>
                <tr>
                    <td>Id</td>
                    <td>Nome</td>
                    <td>Op</td>
                </tr> 
                <%
                    for (Object u : lc) {
                        Categoria c = (Categoria) u;
                %>
                <tr>
                    <td><a href="<%="ListaProdottiXCat?cat="+c.getIdcategoria()%>"><%= c.getIdcategoria()%></a></td>
                    <td><%= c.getNome()%></td>
                    <td><a href="<%="RimuoviCategoria?cat="+c.getIdcategoria()%>">Rimuovi</a></td>
                </tr>
                <%            }
                %>
            </tbody>
        </table>
    </body>
    <%
        }
    %>
</html>
